#取代基数量统计
n=int(input())
dp=[0]*(n+1)
dp[0]=dp[1]=dp[2]=1
for i in range(3,n+1):
    for j in range((i-1)//3,i):
        for k in range((i-j)//2,j+1):
            L=i-1-j-k
            if L<0:
                break
            if j==k and k==L:
                dp[i]+=dp[j]*(dp[j]-1)*(dp[j]-2)//6+dp[j]*dp[j]
            elif j!=k and k!=L:
                dp[i]+=dp[j]*dp[k]*dp[L]
            else:
                p=q=0
                if j==k:
                    p=j;q=L
                else:
                    p=L;q=j
                dp[i]+=dp[q]*dp[p]*(dp[p]+1)//2
            print(j,k,L,dp[i])
    print("--------->",i,dp[i])